<%@ page language="java" contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>


<!DOCTYPE html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="apple-itunes-app" content="app-id=591578609">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width"/>
<meta name="description" content="筑学堂网校" />
<meta name="keywords" content="筑学堂网校、建筑、考试"/>
<link href="http://www.zhuclass.com/img/icon.ico" type="image/x-icon" rel="icon"  />
<link href="http://www.zhuclass.com/img/icon.ico" type="image/x-icon" rel="shortcut icon"  />
<link rel="stylesheet" type="text/css" href="${csspath}/style/my_plat.css">
<link rel="stylesheet" type="text/css" href="${csspath}/style/teac_plat.css">
<!--[if IE 7]>
<link rel="stylesheet" href="/css/font-awesome/css/font-awesome-ie7.min.css">
<![endif]-->
<script type="text/javascript" src="${jspath}/js/study.js"></script>
<script type="text/javascript" src="${jspath}/js/jquery-1.11.1.js"></script>
<script type="text/javascript" src="${jspath}/js/ajaxfileupload.js"></script>
        <script type="text/javascript">
    function ajaxFileUpload()
    {
        
        
        $.ajaxFileUpload
        (
            {
                url:'/drm/att/up?token=12qwaszxcvdfer34',//用于文件上传的服务器端请求地址
                secureuri:false,//一般设置为false
                fileElementId:'file',//文件上传空间的id属性  <input type="file" id="file" name="file" />
                dataType: 'json',//返回值类型 一般设置为json
                success: function (data, status)  //服务器成功响应处理函数
                {
                    alert(data.msg);//从服务器返回的json中取出message中的数据,其中message为在struts2中action中定义的成员变量
                    
                    if(typeof(data.code) != 1)
                    {
                         
                            alert(data.id);
                            
                            $("#attchmentdwon").attr("href","http://182.92.157.212/drmdown/"+data.id+"?fnm="+data.filename)   
                            
                             $("#attchmentdwon").text("可以下载文件"+data.filename);
                         $("#showimg").show();
                         $("#showimg").attr("src","http://182.92.157.212/drmimg/"+data.id)
                    }
                    //附件
                    //{"id":"723da7453ebdbdc1b5526f5889e3f590","oid":"53fb5bc26b2d42d7594bf2c0","flength":87559,"filename":"536625.jpg","code":0,"ftype":"image/jpeg"}
                },
                error: function (data, status, e)//服务器响应失败处理函数
                {
                    alert(e);
                }
            }
        )
        
        return false;

    }
    </script>


<title>筑学堂家园个人空间</title>
<style type="text/css">
a {
	color:#222;
	text-decoration:none;
}
ul li {
	list-style-position:inside;
	list-style-type:disc;
	margin:0;
	padding:0;
}
ol li {
	list-style-position:inside;
}
</style>
</head>
<body style="align:center; padding:0;margin:0;clear:both; background-color:FEFEFE;">
 <img src="loading.gif" id="loading" style="display: none;">
        <input type="file" id="file" name="upload" />
        
         <img src="loading.gif" id="showimg" style="display: none;">
        
        <br />
        <input type="button" value="上传" onclick="return ajaxFileUpload();">
        
        <a id="attchmentdwon" href ="#"> 等待生成图片，点击下载</a>
</body>
</html>
